package com.cd.card.repository;

import com.cd.card.domain.LqqCardRecord;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import javax.transaction.Transactional;
import java.util.List;
import java.util.Optional;

/**
 * @Description create by JPA BUDDY
 * @Author lqq
 * @Date 2024/8/20 9:43
 **/
@Repository
public interface LqqCardRecordRepository extends CrudRepository<LqqCardRecord, Long> {

    List<LqqCardRecord> findByUserId(Long userId);


    @Modifying
    @Transactional
    @Query(value = "update lqq_card_record set dtype='LqqCardRecord' where dtype is null or dtype=''",nativeQuery = true)
    int updateAllDType();

}